extends "res://Props/scripts/CommonProp.gd"

# 免疫药水
# 玩家收到的所有伤害为0

@export var time = 5		## 免疫时长(单位:S)

@onready var timer = $Timer

var state = null
func use(body, util):
	timer.wait_time = time
	timer.start()
	timer.connect("timeout", timeout)
	state = util.findOne("$[State]", body)
	state.isImmune = true


func timeout():
	state.isImmune = false
